<script src="https://unpkg.com/vue"></script>


<script>
  var vm = new Vue({
    data: {
      a: 1
    },
    created: function () {
      // `this` 指向 vm 实例
      console.log('created a is: ' + this.a)
    },
    updated: function () {
      console.log('updated a is: ' + this.a)
    },
    mounted: function () {
      console.log('mounted a is: ' + this.a)
    },
    destroyed: function () {
      console.log('destroyed a is: ' + this.a)
    }
  })
  // -> "a is: 1"

</script>
